package com.smmisia.shop.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

@Getter
public enum EnterStatusEnum {

    FLASH_ENTER(0, "闪入园"),
    DELAY_ENTER(1, "延迟入园");
    @EnumValue
    private Integer code;
    private String desc;

    EnterStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static EnterStatusEnum getEnterStatusEnum(Integer code) {
        for (EnterStatusEnum enterStatusEnum : EnterStatusEnum.values()) {
            if (enterStatusEnum.getCode().equals(code)) {
                return enterStatusEnum;
            }
        }
        return null;
    }
}
